#ifndef PIEVIEW_H
#define PIEVIEW_H

/*销售图表功能*/

#include<QAbstractItemView>

class PieView : public QAbstractItemView
{
    Q_OBJECT
public:
    explicit PieView(QWidget *parent = nullptr);

    QRegion itemRegion(QModelIndex index);

signals:


    // QAbstractItemView interface
public:
    void setSelectionModel(QItemSelectionModel *selectionModel) override;
    QRect visualRect(const QModelIndex &index) const override;
    void scrollTo(const QModelIndex &index, ScrollHint hint) override;
    QModelIndex indexAt(const QPoint &point) const override;

protected:
    QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
    int horizontalOffset() const override;
    int verticalOffset() const override;
    bool isIndexHidden(const QModelIndex &index) const override;
    void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command) override;
    QRegion visualRegionForSelection(const QItemSelection &selection) const override;

private:
    QItemSelectionModel *selections;
    QList<QRegion> RegionList;

    // QWidget interface
protected:
    void paintEvent(QPaintEvent *event) override;
};

#endif // PIEVIEW_H
